<?php
!defined('LZ_MODULE') && die('Access Denied');
filter_array($_GET,'action,m,category_id=intval:cid,item_id=intval:id',true);

//通过id等做出内容判断
if ($item_id)
{
	$action = 'show_item';
}
else if ($category_id)
{
	$action = 'show_list';
}
else //默认显示
{
	$category_id = false;
	$action = 'show_list';
}

//显示分类和项目列表
if ($action == 'show_list')
{
	include_once('model/item.php');
	$item = new LZ_Item;
	//分页处理
	$items = lz_page($item,array('category_id'=>$category_id),(intval($config['index_list_page_size']))?intval($config['index_list_page_size']):10,$info);
	$pager = html_pager('?cid='.$category_id,$info['total_page'],$_GET['page']);
	
	$view_data = array
	(
		'items' => $items,
		'page_description' => lang('ITEMS_LIST'),
		'pager' => $pager,
	);

}
else if ($action == 'show_item')
{
	include_once('controller/item.php');
	$_viewer = 'item.html';
}

include_once('controller/sidebar.php');

?>